package day.day05;

import java.util.Arrays;
import java.util.Random;

public class ArraySort {
    public static void main(String[] args) {
        Random rand = new Random();
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = rand.nextInt(100);
        }
        Arrays.sort(arr);
        for (int i = 0; i < arr.length-1 ; i++) {
            System.out.println("升序后数组："+arr[i]);
        }
        for (int i = arr.length-1; i >=0 ; i--) {
            System.out.println("降序后数组"+arr[i]);
        }
    }
}
